package server;

import javax.transaction.xa.Xid;

public class UpdateXid implements Xid {
	private byte branch;
	UpdateXid(byte branch){
		this.branch = branch;
	}
	
	@Override
	public byte[] getGlobalTransactionId() {
		return new byte[]{0};  //mamy tylko jedna globalna transakcje
	}
	
	@Override
	public int getFormatId() {
		return 0;
	}
	
	@Override
	public byte[] getBranchQualifier() {
		return new byte[]{branch};
	}
	
	@Override
	public String toString() {
		Byte b = branch;
		return b.toString();
	}
}